Skip to content

dsh-diagrams: a figure compiler, and two published figures as its benchmark - #22

Merged
vecnode merged 1 commit into
mainfrom
dsh-diagrams/figure-compiler
Nov 29, 2026
Merged

vecnode merged 1 commit into
mainfrom
dsh-diagrams/figure-compiler

Conversation

@vecnode

@vecnode vecnode commented Nov 29, 2026

Copy link
Copy Markdown
Owner

What

A fourth diagram kind, figure, that compiles a JSON spec into one vector figure, and a reference corpus that makes "paper level" testable.

spec ? measure (Core-14 metrics) ? place (rows/columns/panels) ? route (leaders, arrows, braces)
     ? emit SVG ? check geometry (f0-spec ? f1-layout ? f2-paper) ? the panel rasterises PNG at 3�
  • Host-side, deterministic, dependency-free. No browser and no clock in the compile path, so the same spec produces byte-identical SVG and the artifact cache keys on the source alone.
  • Geometry is a contract. Overlap, bounds, an unresolvable link, type below 5.5 pt, two tones that merge in greyscale, a code line wider than its pane � all come back as line-addressable diagnostics, not as a silent picture.
  • Sizes are points, tones are roles (meta, tensor, link, �), and the export is json / svg / png.
  • The tab needs no new code path: a figure compiles to an SVG artifact, which the existing viewer already draws.

The corpus

Two published figures, rebuilt in the grammar, with provenance, an anatomy, an executable rubric and the committed vector:

figure proves
gguf-file-layout (516 pt) a weighted byte strip, a brace over the header, segment-anchored leaders, a boxed pointer tail, tinted code panes, a legend
neo-motivation (516 pt) a three-column motivation plate: ?/? comparison cards, two property lists, a node pipeline with an arrow, a labelled matrix

check-figure-corpus.mjs rebuilds both, requires byte-identical output twice, fails on drift against the committed SVG, and traces every rubric row to a block id and a label in the picture.

Licence note � please read before merging

reference/THIRD-PARTY.md records each target with its sha256 and a removal line. Two caveats, stated plainly:

  • NEO (arXiv:2510.14979, Fig. 2) is under arXiv's non-exclusive licence: it grants arXiv distribution, not this repository. It is committed as an evaluation target with the rights stated; git rm of that one file degrades the corpus check to its structural tier instead of breaking it.
  • GGUF: the source is unpinned. It is the explainer figure that circulates with the GGUF docs; the canonical page and author still have to be established.

Checks

  • check-node-routes.mjs � all passed (8 new figure assertions)
  • check-client-bundles.mjs � all passed (per-kind export formats)
  • check-skill-examples.mjs � 25 passed
  • check-diagrams-kit.mjs � 48 passed
  • check-figure-corpus.mjs � 2 figures, ~80 assertions
  • check-no-secrets.mjs, check-scripts.mjs � OK

Not in this PR

PDF export for figures (no host rasteriser), a TikZ emitter, and a rows stretch so a short column fills its row.

…chmark

A fourth kind (`figure`) compiles a JSON spec on the host: measured with the
Core-14 text tables, placed by rows/columns/panels, routed with orthogonal
leaders, emitted as one SVG at a paper's column width. Geometry is a contract
(f0-spec -> f1-layout -> f2-paper): overlap, bounds, print size, greyscale
separation and a code line wider than its pane come back as diagnostics.

The reference corpus makes "paper level" testable: two published figures
(GGUF byte layout, NEO motivation plate) rebuilt in the grammar, each with a
provenance note, an anatomy, an executable rubric and the committed vector.
check-figure-corpus.mjs rebuilds both, requires byte-identical output, fails
on drift and traces every rubric row to a block id and a label.

Also: the paper-figures skill, figure export (json/svg/png), and the client
reporting the right kind for a compiled picture.
@vecnode
vecnode merged commit 3a6ca3e into main Nov 29, 2026
1 check passed
@vecnode
vecnode deleted the dsh-diagrams/figure-compiler branch November 29, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant